import{setCookie} from '..//tools.js';
 import{APILogina} from '..//fetch.js'

 $('.layui-btn').click( async function () {

    var { code, msg } = await APILogina({
        user:$('#username').val(),
        pass:$('#passwrod').val()
    });
    if ({code}) {
        setCookie('login_user', $('#username').val(), 7);
        location.href = 'http://127.0.0.1:5500/dewu/index1.html'
    } else {
        alert(msg);
    }
})